#coding=utf-8

'''
@author: tongji(tongji@rekoo.com)
'''
from farm_lib.models.user import User
from farm_lib.common import rkmobile

def init_data():
    '''初始化参数数据格式，具体哪个键记什么东西，由后端程序员确定'''
    return {'v1':'', 'v2':'', 'v3':'', 'v4':'', 'num':1}

# --------------------------------下面是要写的回调函数，协议：callback(request, args)
# args是视图执行前后的金币，酷币，经验，等级的状态 
# args = {'before':{'gold':100, ...}, 'after':{'gold':20, ...}}
# 请在返回的字典中设置一个'success'位， 默认为True

def userhome(request, args):
    data = init_data()
    data['v1'] = args['after'].get('co2', '')
    return data
    
    
# 统计白名单，只有加入到这个名单的视图函数才会被记录{全局名字：对应回调函数}

whitelist = {
             'views.tax.complete_tax': None,
             'views.user.home': userhome,
             'views.user.register': None, 
            }